﻿using System.Web.Mvc;
using System.Web.Routing;

namespace SweetSurvey.Controllers
{
    /// <summary>
    /// The interface of UrlHelper.
    /// </summary>
    public interface IUrlHelper
    {
        string Action(string actionName, object routeValues);
        string Action(string actionName, string controllerName);
        string Action(string actionName, string controllerName, object routeValues);
        string Action(string actionName, string controllerName, RouteValueDictionary routeValues);
        
        bool IsLocalUrl(string url);
    }

    /// <summary>
    /// The adaptor of UrlHelper and IUrlHelper.
    /// The purpose of this adaptor is to improve the testability of UrlHelper.
    /// </summary>
    public class UrlHelperAdaptor : UrlHelper, IUrlHelper
    {
        public UrlHelperAdaptor(RequestContext requestContext)
            : base(requestContext) { }
    }
}